<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('头程装箱查询列表')" />
	<th:block th:include="include :: list-css" />
    <style>
       /* .layui-border-box{height: 400px !important;}
		.layui-table-body{height: 290px !important;} */
        .layui-tab-title{border-color: #ccc !important;}
        .layui-this{color: rgb(0, 135, 250) !important;background: none !important;}
        .layui-tab-brief > .layui-tab-title .layui-this:after, .layui-tab-brief > .layui-tab-more li.layui-this:after{border-color:  rgb(0, 135, 250) !important;}
        .mid-content {overflow: auto;}

        /* .layui-table-body{overflow-y: auto;overflow-x: hidden;} */
        /* .layui-table-body{} */
    </style>
</head>
<body class="no-skin">
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
<!--        <div class="layui-btn layui-btn-normal layui-table-tools" id="scorderbtn" lay-event="scorderbtn">-->
<!--            <i class="dhicon dh-zu4491"></i> 审核-->
<!--        </div>-->
<!--        <div class="layui-btn layui-btn-normal layui-table-tools" id="rollbackbtn" lay-event="rollbackbtn">-->
<!--            <i class="dhicon dh-zu4491"></i> 回退-->
<!--        </div>-->
        <div class="layui-btn layui-btn-normal layui-table-tools" lay-event="exportbtn">
            <i class="dhicon dh-zu4250_2_2"></i> 导出
        </div>
        <div class="layui-btn layui-btn-normal layui-table-tools" lay-event="incbtn">
            <i class="dhicon dh-remove"></i> 装箱清单导入
        </div>

    </div>
</script>

<!-- 表格操作区 -->
<script type="text/html" id="barDh">
    <a class="layui-btn layui-btn-danger layui-btn-xs" onclick="editbtn('{{d.guid}}','{{d.code}}')" shiro:hasPermission="oa:materialmaintenance:edit">修改</a>
</script>


<th:block th:include="listinclude :: fbaboxdetail" />
<th:block th:include="include :: footer" />
<th:block th:include="include :: tableBtn" />
<th:block th:include="listinclude :: list-templeat" />
<th:block th:include="include :: searchJS" />
<!--<th:block th:include="include :: listJS" />-->

<script th:inline="javascript">
    /*<![CDATA[*/
    var gridColumns = [[${gridColumns}]],
        business = [[${business}]],
        buttonState = [[${buttonState}]],
        businessName = gridColumns.moduleAlias,
        passwordAuthentication = [[${passwordAuthentication}]],
        moduleTable = [[${moduleTable}]];
    /*]]>*/
    var prefix = "/logstics/"+business;
    var tableUrl = prefix + "/list";
    openRowUrl = "/business/"+(business.split('/')[1]?business.split('/')[0]:business)+"/edit?nid=";
    var $,layer,laydate,form,table,wherestr={};
</script>

<script type="text/javascript">
    var element,thStr;
    var fieldWidth = {},		//导入列表字段宽度
        filedRequired = {},		//导入列表必填字段
        dateFiled = [],			//导入列表日期字段
        hasNull = false;		//导入数据必填字段有空值
    $.each(gridColumns.dictionaryForPageFieldList,function(i,v){
        fieldWidth[v.fields] = v.fieldFrontWidth
        if(v.fieldFrontRequired)filedRequired[v.fields] = v.fieldName;
        if(v.fieldFrontType == 't_date')dateFiled.push(v.fields);
    })
    var $,layer,laydate,form,table,wherestr={};
    layui.use(['table','laydate','form','layer','jquery','element'], function () {
        $ = layui.$, layer = layui.layer,laydate = layui.laydate , form = layui.form, table = layui.table, element = layui.element;
        serachRender();//查询条件初始渲染集合
        changeDropdown('fSl');//导入窗口——税率下拉可编辑赋事件
        $.tablelist.init({
            elem: '#dhtable'
            ,modalName: "头程装箱单"
            ,url: prefix + '/list'
            ,updateUrl: prefix + "/edit?guid={id}"
            ,initSort: {field: 'createTime',type: 'asc'}
            ,totalRow: gridColumns.totalRow
            ,cols: [gridColumns.gridBody]
            ,toolbar: '#toolbar'
            ,defaultToolbar: [{title:'列设置',layEvent: 'fieldSet',icon: 'layui-icon-set'}] //这里在右边显示
            ,height:'full-65'
        });
        //监听排序事件
        table.on('sort(ftable)', function(obj){
            $.tablelist.sort('dhtable',obj);
        });

        //监听行双击事件
        table.on('rowDouble(ftable)', function (obj) {
            top.layui.index.openTabsPage(prefix+ "/edit?guid="+obj.data.guid,'头程装箱单 - 修改')
        });

        //头工具栏事件
        table.on('toolbar(ftable)', function(obj){
            switch(obj.event){
                case 'exportbtn':
                    $.ajax({
                        url: '/logstics/fbabox/export',
                        type: 'GET',
                        data: getWherestr(),
                        dataType: 'json',
                        beforeSend: function(){
                            showloadings(true);
                        },
                        success: function(result){
                            if (result.code == 0) {
                                window.location.href = ctx + "common/download?fileName=" + encodeURIComponent(result.msg) + "&delete=" + true;
                                parent.$('.page-loading').hide();//页面进行了跳转刷新，需要手动关闭页面的加载动画
                            } else if (result.code == web_status.WARNING) {
                                $.modal.alertWarning(result.msg)
                            } else {
                                $.modal.alertError(result.msg);
                            }
                            showloadings(false);
                        }
                    });
                    break;
            };
        });
    });

    //弹出框修改
    function editbtn(guid){
        top.layui.index.openTabsPage(prefix+ "/edit?guid="+guid,'头程装箱单 - 修改')
    }
</script>

</body>
</html>